package org.rebluh.hulunbuirtravelnetworkbackendframework.service;

import org.rebluh.hulunbuirtravelnetworkbackendframework.domain.Panorama;
import org.rebluh.hulunbuirtravelnetworkbackendframework.repository.PanoramaRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PanoramaService {
    @Autowired
    private PanoramaRepository panoramaRepository;

    // 添加数据
    public Panorama createPanorama(Panorama panorama) {
        return panoramaRepository.save(panorama);
    }

    // 获取全部全景图
    public List<Panorama> getAllPanorama() {
        return panoramaRepository.getAllPanorama();
    }

    // 获取景区对应全景图
    public List<Panorama> getPanoramaByToHulberId(String toHulberId) {
        return panoramaRepository.findByToHuberId(toHulberId);
    }
}
